$OpenBSD: patch-src_cmd_link_internal_ld_ldelf_go,v 1.1 2017/06/04 18:04:03 jsing Exp $
--- src/cmd/link/internal/ld/ldelf.go.orig	Thu May 25 04:15:12 2017
+++ src/cmd/link/internal/ld/ldelf.go	Mon Jun  5 01:58:33 2017
@@ -9,6 +9,7 @@ import (
 	"fmt"
 	"io"
 	"log"
+	"runtime"
 	"sort"
 	"strings"
 )
@@ -1053,6 +1054,13 @@ func readelfsym(ctxt *Link, elfobj *ElfObj, i int, sym
 				if s != nil && sym.other == 2 {
 					s.Type |= obj.SHIDDEN
 					s.Attr |= AttrDuplicateOK
+				}
+
+				// TODO(jsing): Currently, clang on OpenBSD is generating hidden
+				// __guard_local symbols, which is tripping up the Go linker.
+				// As a workaround, mark the symbol as visible for the time being.
+				if s != nil && runtime.GOOS == "openbsd" && sym.name == "__guard_local" {
+					s.Type &^= obj.SHIDDEN
 				}
 			}
 
